package kr.hkit.powerjava.chapter22.submit2.vo;

public class Department {
	private int deptNo; //부서번호
	private String deptName; //부서이름
	private int floor; //몇층
	
	public Department(int deptNo, String deptName) {
		this.deptNo = deptNo;
		this.deptName = deptName;
	}
	public Department(int deptNo, String deptName, int floor) {
		this.deptNo = deptNo;
		this.deptName = deptName;
		this.floor = floor;
	}
	
	public int getDeptNo() {
		return deptNo;
	}
	public void setDeptNo(int deptNo) {
		this.deptNo = deptNo;
	}
	public String getDeptName() {
		return deptName;
	}
	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}
	public int getFloor() {
		return floor;
	}
	public void setFloor(int floor) {
		this.floor = floor;
	}
	
	@Override
	public String toString() {
		return String.format("%10s\t%4s\t%3s",deptNo, deptName, floor);
	}
	
	@Override
	public boolean equals(Object obj) { //학과부서랑 학과이름 같은거 있는지 비교 
		Department dept = (Department) obj;
		return (deptNo==dept.deptNo && deptName.equals(dept.deptName));
		
	}
	
	
	
}
